home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Free 11
/
Commodore_Free_Issue_11_2007_Commodore_Computer_Club.d64
/
t.iv glenn
< prev
next >
Wrap
Text File
|
2023-02-26
|
9KB
|
334 lines
u POWER c compiler
Glenn Holmer
(Q-Link: ShadowM)
http://www.lyonlabs.org/commodore/
c64.html
Q-Please introduce yourself to our
readers
A-My name's Glenn Holmer, a Java prog-
rammer living in Milwaukee, WI (USA).
I've been a programmer & a C= user for
20 years, & have a web page at http:/
/www.lyonlabs.org/commodore/c64.html.
Q-Can you give some brief info on your
computing background & how you came
across the C= Brand?
A-My first job with computers was as an
operator on an IBM 4331. All the
applications in our shop were written
in BAL assembler & I couldn't figure it
out, so I thought I'd buy a computer of
my own to see if it would help (it did)
I picked the C64 because of its sound
capabilities & have been in love ever
since.
Q-Please explain to our reader what
"power c" is & what the C
programming language is
A-C was developed in the early 1970's &
was intended as a substitute for
assembly language that was faster &
easier to code. Power C is a C 64/128
C compiler, released by Spinnaker in
1986; an earlier version by Pro-Line in
Canada was known as C Power.
Q-Can you give our reader a brief
syntax from basic to C, maybe a count
down timer so they can see the format
of the C programming language
A-Sure... here it is in BASIC:
10 FOR I = 10 TO 0 STEP -1
20 PRINT I
30 NEXT
40 PRINT "BLAST-OFF!"
and in C:
int main
(argc, argv)
int argc;
char **argv; [
int i;
for (i = 10; i >= 0; i--) [
printf("%d\n", i);
]
puts("BLAST-OFF!"); ]
Q-Do you think in your opinion C
programming language is easier than say
C= Basic or another language?
A-As you can see from the example
above, C is more difficult. This
becomes more apparent as you begin to
work with other features of the
language like structures & pointers.
On the other hand, as the saying goes,
with knowledge comes power!
Q-one of the benefits of C programming
language is that it is "portable" can
you explain the term & how "portable"
is the power C code
A-Since C is a very simple language &
relies on libraries for much of its
functionality, compilers can be written
for different machines that can take
the same source file & produce a work-
ing program specific to the machine at
hand. Power C code is not quite so
portable to other machines because it
uses an older dialect known as "K&R".
Q-Is C language an industry standard?
A-It has become less common for prog-
rammers to know C; now they are more
likely to know C++ or Java. But C is
still everywhere, & the syntax of C++ &
Java are based on it.
Q-I remember reading that the original
C= Amiga libraries were written in c
also C is heavily used in the PC & Unix
world. If learning Power C would the
same principles apply to other formats
of machines
A-Absolutely. As I said, Power C uses
an older dialect, but what you learn
about pointers & so forth would
definitely carry over.
Q-What makes "Power C" an appealing
language, & why utilise this on C=
machines
A-There is something about the syntax
of C that is very seductive: it is
compact & expressive at the same time.
Once you learn it well,you can code
very fast, which makes it appealing to
use on a C=.
Assembly language takes too long to
code, & higher level languages like
Pascal or COBOL take too much memory.
Q-What is SWL?
A-SWL is "Shadow's Widget Library".
Shadow is my nickname, & SWL is a set
of Power C libraries I wrote that are
designed to make it easy to create
sophisticated user input screens from
Power C.
Q-Is this a labour of love or do you
know people are actively using the
language & the extra extensions you
have created
A-I only released the SWL libraries
a week ago (although I did talk about
them at the C=4 Expo in Cincinnati), so
I don't suppose there are lots of
people using them yet! I have been in
contact with several other people who
are using Power C both here & abroad,
but would like to see it used more,
because its libraries are so easy to
share.
Q-Please tell our reader about Power
c extensions,
A-Power C source files are compiled
into object files, & object files are
linked together to form executable
programs. You may have to link your
object file with several others to
complete that process. But if several
object files are used to build a
library, you need only tell the linker
the library name, & it will find all
the entry points in all the associated
object files by name. If you link a
program against the SWL object code,
for example, you may have to type in
the names of up to six files at the
linker prompt. But if you use the
library, you only type "swl.l", & the
linker includes what it needs from all
6 of them.
Q-What are widgets
A-This is an old term that refers to
the elements that make up a user inter-
face: text input fields, checkboxes,
etc.
Q-Are all the extension to power C on
your page created by yourself
A-Not at all! Everything in the down-
loads section on my site was written by
other programmers in the heyday of
Power C & the C=. The only code that's
mine is SWL & the drive enumeration &
relative file support routines that
come with it. I hope there wasn't any
confusion about that, but I've added
all the authors' names next to the
links.
Q-Is the Compiled c language as fast as
machine code
A-Almost.
Q-What does it take to use Power C?
A-While you can write & compile
programs using a single 1541 drive, the
more power you throw at it, the better.
Compiles of long programs can take
quite some time, so if you can get your
hands on them, I would recommend a
SuperCPU & a CMD hard drive or two.
Q-Where wouldn't Power C be a good
language to use for example could Games
be written in the language or is C
designed for business applications
A-I think you could use it for just
about any type of application. The
limiting factor would be the memory
usage. Compiled C on the C= is pretty
fast, but takes up a lot of memory.
Most of the time I spent developing SWL
was spent translating earlier versions
written in C into assembly so a program
using them would still fit!
Q-You seem to be a collector of
operating system & interpreters &
compilers for Commodore machines, is
this some obsession, & why the
fascination
A-Yes, it's an obsession! I will never
have enough compilers! Send me more
that I may feed upon them & grow
strong! Seriously, I've always been
fascinated with languages, both spoken
& computer. I would like to give a
presentation at one of the C= expos
about what languages are available, but
have become very focused on mastering
Power C.
Q-What is your favorite C= operating
system & compiler/interpreter & why
A-For compilers, it's Power C, no
doubt about that. Operating system is
a little more complicated. I like the
idea of Contiki, but it is, shall we
say, not particularly robust. I'm
interested in learning more about
LUnix, which was an attempt at writing
a multitasking Unix-like operating
system for the C=
Q-What would be your least favorite &
why
A-C= BASIC, I guess! The '64 doesn't
have much of an operating system, or I
would put that in the same category.
The C=64 just begs to have new tools
created for it!
Q-You said in a recent email you were
releasing "version 1.00 of the SWL
libraries", are there more to come or
will you concentrate on making these as
bug free & compact as possible
A-The next step is to write an
application based on SWL. This is
actually why I wrote the libraries in
the first place: I wanted to write a
Power C app but didn't want to re-
invent the wheel if I decided I wanted
to use the input routines again later.
It was a detour of many months, but now
that I'm actually writing the
application, it's going very quickly.
I'd love to see people use (or at
least try) SWL, & I welcome bug
reports. In my dreams, I also see a
community of Power C programmers
sharing sound, networking, & graphics
libraries they have written. A lot of
resources are available on my Power C
page,
http://www.lyonlabs.org/commodore/
powerc.html.
Q-Are there any applications written in
power C especially utilising these ext-
ensions our readers can download to
look at what is achievable
A-Come to ECCC in Chicago on SEP 27 :)
Things that are being considered for
the next version: (bug) banner text
centered wrong (one character to the
right) doList() should show a title
if one is passed menus should support
paging, or at least home/shifthome
allow for scrolling single- line text
entry (and maybe labels) when there is
more text than can be displayed for
drive routines, add functions to send
disk command & read error channel
(already in my working copy) I'm also
working on a replacement for Power C's
malloc() & free() functions, because
they use a first- fit algorithm that
leaks memory; a program that repeatedly
allocates & frees large numbers of SWL
"objects" will find itself out of
memory very quickly (the worst-case
scenario is a program that repeatedly
reads CMD directories into a menu
structure, then frees the directory
entries & menu items & allocates new
ones as the directory tree is
traversed). Naturally, that's turning
into a saga of mythic proportions. To
find out all the gory details (inc-
luding a snapshot of the source code),
offer suggestions, or just tell me I'm
crazy to be doing this, visit my web log...
http://www.lyonlabs.org/roller/shadow/
entry/swlDshadowDsDwidgetDlibrary